package com.c1.client.menu.item;

import com.c1.client.menu.MenuManager;
import com.s.core.root.Ad;
import com.s.core.root.As;
import org.apache.commons.collections.CollectionUtils;

import javax.swing.*;
import java.awt.event.KeyEvent;
import java.util.List;

public class A_MItem extends MItem {
    @Override
    public KeyStroke keyStroke() {
        return KeyStroke.getKeyStroke(KeyEvent.VK_A, 0);
    }

    @Override
    public String showName() {
        return "查看自选";
    }

    @Override
    public void process() {
        List<String> selectCodes = As.me().list();
        if (!CollectionUtils.isEmpty(selectCodes)) {
            String date = Ad.me().getDateList().get(0);
            MenuManager.me().showStocksByCodes(selectCodes, date);
        }
    }

    @Override
    public boolean needCodePics() {
        return false;
    }
}
